<?php require_once('../../Connections/shopcarda1.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_shopcarda1, $shopcarda1);
$query_prod_type_r = "SELECT * FROM prod_type ORDER BY pt_id ASC";
$prod_type_r = mysql_query($query_prod_type_r, $shopcarda1) or die(mysql_error());
$row_prod_type_r = mysql_fetch_assoc($prod_type_r);
$totalRows_prod_type_r = mysql_num_rows($prod_type_r);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>selectBoxes 動態下拉式選單</title>
<script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="../js/selectboxes.js"></script>
<script type="text/javascript" src="../js/prod.js"></script>
</head>
<body>

<h3>主機 - 類型 - 遊戲（預設值：XBOX360／FPS／刺客聯盟）</h3>

<p>
<select id="select1">
  <?php
do {  
?>
  <option value="<?php echo $row_prod_type_r['pt_id']?>"><?php echo $row_prod_type_r['type']?></option>
  <?php
} while ($row_prod_type_r = mysql_fetch_assoc($prod_type_r));
  $rows = mysql_num_rows($prod_type_r);
  if($rows > 0) {
      mysql_data_seek($prod_type_r, 0);
	  $row_prod_type_r = mysql_fetch_assoc($prod_type_r);
  }
?>
</select>
<select id="sort">
<option value="">請選擇</option>
</select>

</body>
</html>
<?php
mysql_free_result($prod_type_r);
?>
